package com.jhx.video.discuss

import android.app.Activity
import com.jhx.common.framework.BasePresenter
import com.jhx.common.framework.BaseView
import com.jhx.video.model.VideoDetail

/**
 *
 * @author Jack 2018-03-28 10:52
 */
class Contract {

    interface DiscussView : BaseView {
        /**
         * 获取评论列表成功
         */
        fun getCommentSuccess(data: VideoDetail?)

        /**
         * 操作失败
         */
        fun requestError(url: String, msg: String)

        fun getContext(): Activity

        /**
         * 删除成功
         */
        fun deleteVideoSuccess()

        /**
         * 置顶成功
         */
        fun stickVideoSuccess()

        /**
         * 回复评论成功
         */
        fun replyCommentSuccess()
    }

    abstract class DiscussPresenter : BasePresenter<DiscussView>() {
        /**
         * 获取评论列表
         */
        abstract fun getComment(vid: String, pageIndex: Int, pageSize: Int,
                                onStart: (() -> Unit)? = null, onComplete: (() -> Unit)? = null)

        abstract fun deleteVideo(id: String)
        abstract fun stickVideo(id: String, isTop: Int)
        abstract fun replyComment(id: String, text: String)
    }
}